<template>
  <div class="main">
  <keep-alive>
    <router-view v-if="keepAlive" />
  </keep-alive>
  <router-view v-if="!keepAlive" />
  </div>
</template>

<script>
  export default {
    name: "RouteView",
	props: {
		closeTab: {
			type: Function,
			default: null
		}
	},
    computed: {
      keepAlive () {
        return this.$route.meta.keepAlive
      }
    },
	methods: {
		closeRouteViewTab(key) {
			console.log(key)
			if(this.closeTab) {
				this.closeTab(key)
			}
		}
	}
  }
</script>